/*
Copyright 2008, 2009 Joonas Lehtolahti

This file is part of Openfire-C.

Openfire-C is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Openfire-C is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with Openfire-C.  If not, see <http://www.gnu.org/licenses/>.
*/

/* Include analyze functions */

#define NEXT_NODE(X) X = X->next

#include "XfirePacketAnalyze_login.inc"
#include "XfirePacketAnalyze_system.inc"
#include "XfirePacketAnalyze_friends.inc"
#include "XfirePacketAnalyze_im.inc"
#include "XfirePacketAnalyze_downloads.inc"
#include "XfirePacketAnalyze_clans.inc"
#include "XfirePacketAnalyze_groupchat.inc"
#include "XfirePacketAnalyze_servers.inc"
#include "XfirePacketAnalyze_videos.inc"

/**
 * XfireAnalyze_hFallBack (XFINST inst, struct XfirePacket *packet)
 *   Internal handler for case of no special handler found
 * 
 * Parameters:
 *   inst    the Xfire instance
 *   packet  the packet data
 * 
 * Returns:
 *   XFIH_FATAL           external handler returned XFNH_FATAL
 *  The following return values may be combined using a bitwise OR fashion:
 *   XFIH_PENDING         all external handlers were not called
 *   XFIH_HANDLED         data handled internally = no XFNH_NOHANDLE seen
 *   XFIH_UNKNOWN (+)     data unknown for internal handling
 *   XFIH_EXTERNAL        data handled externally
 */
int XfireAnalyze_hFallBack(XFINST inst, struct XfirePacket *packet) {
	unsigned int retval = XFIH_HANDLED|XFIH_UNKNOWN;
	
	/* define external handler function type and calling parameters */
	#define _XFABT struct XfirePacket *
	#define _XFABP packet
	/* include external handlers calling */
	#include "XfirePacketAnalyzeExt.inc"
	
	/* No internal handling */
	return retval;
}
